package com.ponhu.ea2.enums;

/**
 * 物料等数据来源
 * @author Wang
 * @date 2021/11/20 10:30 上午
 */
public enum MaterialSourceEnum {
    CLOUD_TRADE(1, "云商"),
    SHENZHEN(2, "深圳"),
    XBIAO(3, "腕表之家"),
    PONHU(4, "胖总管"),
    PH(5,"胖虎")
    ;

    private Integer code;

    private String name;

    MaterialSourceEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getName(Integer code){
        if(code == null){
            return null;
        }
        for (MaterialSourceEnum c : MaterialSourceEnum.values()) {
            if (code.equals(c.getCode())) {
                return c.name;
            }
        }
        return null;
    }
}
